package beanstao.util.j2ee.request;

import java.util.Map;
import java.util.Map.Entry;

import beanstao.util.store.KV;

/**
 * 来自Socket的协议数据
 * 
 * @author beanstao@google.com 
 */
public class SocketQD extends AbstractQD
{
	public static SocketQD ME()
	{
		return new SocketQD();
	}

	/**
	 * 将来源数据封装，交用IMessageProcess类型处理成Map再交由本方法创建IRequestData
	 * 
	 * @param map
	 * @return
	 */
	public static SocketQD fromHashMap(String queryType, final Map<String, String> map)
	{
		SocketQD data = new SocketQD();
		data._QueryType = queryType;
		for (Entry<String, String> entry : map.entrySet())
			data._KeyValueMap.put(entry.getKey(), KV.ME(entry.getKey(), entry.getValue()));
		return data;
	}

	private String _Command = "";

	public String getCommand()
	{
		return _Command;
	}

	public void setCommand(String command)
	{
		_Command = command;
	}
}
